﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Management;
using System.Text;
using WMI.NET.Abstracts;
using WMI.NET.CIM;

namespace WMI.NET.ComputerSystemHardware.MassStorage
{
    /// <summary>
    /// The Win32_AutochkSetting WMI class represents the settings for the autocheck operation of a disk.
    /// </summary>
    public class Win32_AutochkSetting : CIM_Setting
    {

        private Nullable<UInt32> _UserInputDelay;

        /// <summary>
        /// User input delay for autocheck.(Seconds) 
        /// </summary>
        public Nullable<UInt32> UserInputDelay { get { return _UserInputDelay; } set { throw new NotImplementedException(); } }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public Win32_AutochkSetting(ManagementBaseObject mbo)
            : base(mbo)
        {
            _UserInputDelay = mbo.GetUIntValue("UserInputDelay");
        }
    }


    /// <summary>
    /// 
    /// </summary>
    public class GetWin32_AutochkSettings : Win32Collection<Win32_AutochkSetting>
    {

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override ReadOnlyCollection<Win32_AutochkSetting> GetCollection()
        {
            List<Win32_AutochkSetting> tempCollection = new List<Win32_AutochkSetting>();

            foreach (var s in searcher.Get())
            {
                Win32_AutochkSetting tempListItem = new Win32_AutochkSetting(s);
                tempCollection.Add(tempListItem);
            }

            return tempCollection.AsReadOnly();
        }

        /// <summary>
        /// 
        /// </summary>
        public GetWin32_AutochkSettings() : base("SELECT * FROM Win32_AutochkSetting") { }

    }

}
